const path = require('path')
const grpc = require('@grpc/grpc-js')
const protoLoader = require('@grpc/proto-loader')

//声明proto文件路径
const PROTO_PATH = path.join(__dirname,'message.proto')
const packageDefinition = protoLoader.loadSync(PROTO_PATH,{keepCase:true,longs:String,
                                                                        enums:String,
                                                                        defaults:true,
                                                                        oneofs:true})
const protoDescriptor = grpc.loadPackageDefinition(packageDefinition)
const message_proto = protoDescriptor.message


module.exports = message_proto